<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Contact</title>
<!-- Custom Theme files -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //Custom Theme files -->
<link href="/front/css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
<link href="/front/css/style2.css" type="text/css" rel="stylesheet" media="all">
<!-- js -->
<script src="/front/js/jquery.min.js"></script>
<script type="text/javascript" src="/front/js/bootstrap-3.1.1.min.js"></script>
<!-- //js -->
<!-- cart -->
<script src="/front/js/simpleCart.min.js"> </script>
<!-- cart -->
<script src="/front/js/simpleCart.min.js"> </script>
<!-- 表单验证 -->
<script src="/front/js/modifyUser.js"> </script>

	<script type="text/javascript">       
            function YYYYMMDDstart()
 
            {
                  birthday = [[${birthday}]];
	              month = [[${month}]];
	              day = [[${day}]];
                MonHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
               document.getElementById("IYear").innerHTML=birthday;
               document.getElementById("IMonth").innerHTML=month;
               document.getElementById("IDay").innerHTML=day;
                //先给年下拉框赋内容
               var d = new Date();
               d.setFullYear(parseInt(birthday));             
               var y = d.getFullYear();
                for (var i = (y-100); i < (y+100); i++) //以今年为准，前30年，后30年
                    document.form1.YYYY.options.add(new Option(" "+ i, i));
                //赋月份的下拉框
                for (var i = 1; i < 13; i++)
                          document.form1.MM.options.add(new Option(" " + i , i)); 
                document.form1.YYYY.value = y;                
                  document.form1.MM.value = month;               
                  var n = MonHead[month];              
                  if (month ==1 && IsPinYear(YYYYvalue)) n++;
                    writeDay(n); //赋日期下拉框             
               document.form1.DD.value = day;
            }
            if(document.attachEvent)
                window.attachEvent("onload", YYYYMMDDstart);
            else
                window.addEventListener('load', YYYYMMDDstart, false);
 
            function YYYYDD(str) //年发生变化时日期发生变化(主要是判断闰平年)
 
            {
 
                var MMvalue = document.form1.MM.options[document.form1.MM.selectedIndex].value;
 
                if (MMvalue == ""){ var e = document.form1.DD; optionsClear(e); return;}
 
                var n = MonHead[MMvalue - 1];
 
                if (MMvalue ==2 && IsPinYear(str)) n++;
 
                    writeDay(n)
 
            }
 
            function MMDD(str)  //月发生变化时日期联动
 
            {
 
                var YYYYvalue = document.form1.YYYY.options[document.form1.YYYY.selectedIndex].value;
 
                if (YYYYvalue == ""){ var e = document.form1.DD; optionsClear(e); return;}
 
                var n = MonHead[str - 1];
 
                if (str ==2 && IsPinYear(YYYYvalue)) n++;
 
                    writeDay(n)
 
            }
 
            function writeDay(n)  //据条件写日期的下拉框
 
            {
 
                var e = document.form1.DD; optionsClear(e);
 
                for (var i=1; i<(n+1); i++)
 
                    e.options.add(new Option(" "+ i , i));
 
            }
 
            function IsPinYear(year)//判断是否闰平年
 
            { 
 
                return(0 == year%4 && (year%100 !=0 || year%400 == 0));
 
            }
 
            function optionsClear(e)
 
            {
 
                e.options.length = 1;
 
            }
 
  
 
    </script>
	
</head>
<body>
		<!--header-->
	<div class="header">
		<div class="container">
			<nav class="navbar navbar-default" role="navigation">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<h1 class="navbar-brand"><a  href="index">Yummy</a></h1>
				</div>
				<!--导航栏navbar-header-->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="/index" class="active">首页</a></li>
                        
						<li >
							<a href="#">生日蛋糕</a>
							
					   <li class="dropdown grid">
							<a href="#">精品糕点</a>
										
						<li class="dropdown grid">
							<a href="#" class="dropdown-toggle list1" data-toggle="dropdown">联系我们 </a>
														
					</ul> 
					<!--/.navbar-collapse-->
				</div>
				<!--//navbar-header-->
			</nav>
			<div class="header-info">
              <!--导航栏查找小标志-->
				<div class="header-right search-box">
					<a href="#"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></a>				
					<div class="search">
						<form class="navbar-form">
							<input type="text" class="form-control">
							<button type="submit" class="btn btn-default" aria-label="Left Align">
								Search
							</button>
						</form>
					</div>	
				</div>
                <!--导航栏登录小标志-->
				<div class="header-right login">
					<a href="#"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></a>
					<div id="loginBox">                
						<form id="loginForm">
							<fieldset id="body">
								<fieldset>
									<label for="Username">Username</label> 
									<input type="text" name="userUsername">
								</fieldset>
								<fieldset>
									<label for="password">Password</label> 
									<input type="password" name="userPassword">
								</fieldset>
								<input type="submit" id="login" value="Sign in">
								<label for="checkbox"><input type="checkbox" id="checkbox"> <i>Remember me</i></label>
							</fieldset>
							<!--  <p>New User ? <a class="sign" href="account">Sign Up</a> <span><a href="#">Forgot your password?</a></span></p>-->
							<p>New User ? <a class="sign" href="account">Sign Up</a> <span><a href="#">Forgot your password?</a></span></p>
						</form>
					</div>
				</div>
                <!--导航栏购物车小标志-->
				<div class="header-right cart">
					<a href="#"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span></a>
					<div class="cart-box">
						<h4><a href="checkout">
							<span class="simpleCart_total"> $0.00 </span> (<span id="simpleCart_quantity" class="simpleCart_quantity"> 0 </span>) 
						</a></h4>
						<p><a href="javascript:;" class="simpleCart_empty">Empty cart</a></p>
						<div class="clearfix"> </div>
					</div>
				</div>
				<div class="clearfix"> </div>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
	<!--//header-->
	<!--contact-->
	<div class="contact">
		<div class="container">						
		 	<h2>Modify Information</h2>			
			<div class="contact-form">				
				<form name="form1" action="/update/1" method="post">
					<span>Name*</span>
					<input type="text" th:value="*{user.userUsername}" name="userUsername" id="userUsername" required="">	
					<div id="userUsernameInfo" style="color:red;margin: 1px 300px;"></div>
					<span>Email*</span>
					<input type="text" th:value="*{user.userEmail}" name="userEmail" id="userEmail"  required="">	
					<div id="userEmailInfo" style="color:red;margin: 1px 300px;"></div>
					<span>Telephone*</span>
					<input type="text" th:value="*{user.userPhone}" name="userPhone" id="userPhone" required="">
					<div id="userPhoneInfo" style="color:red;margin: 1px 300px;"></div>
					<span>Password*</span>
					<input type="password" th:value="*{user.userPassword}" name="userPassword" id="userPassword" required="">
					<div id="passwordInfo" style="color:red;margin: 1px 300px;"></div>
					<span>RePassword*</span>
					<input type="password" id="repassword" th:value="*{user.userPassword}">
					<div id="repasswordInfo" style="color:red;margin: 1px 300px;"></div>
					<span>Year*</span>
					 <select name="YYYY" onchange="YYYYDD(this.value)">  
					<option th:value="*{birthday}" id="IYear"></option>  
					</select>  
					<span>Month*</span>
					<select name="MM" onchange="MMDD(this.value)"> 
					<option th:value="*{month}" id="IMonth"></option>  
					</select>  
					<span>Day*</span>
					<select name="DD">
					<option th:value="*{day}" id="IDay"></option>  
					</select>  	
					<input type="submit" hidden>							
					<!-- <a href="/update/1" class="btn1"><center>Submit</center></a> --> 
					<button class="btn1" >Submit</button> 
				</form>
				 <!-- <form action = "" method="post">
				  <input type="hidden" name="_method" value="PUT">
				</form>  -->
			</div>	
		</div>
	</div>
	<!--//contact-->
	<div class="footer-bottom">
		<div class="container">
			<p> 2019 yummy cakes for u.
		</p>
		</div>
	</div>
</body>
</html>